package ar.edu.unq.persistencia.Rate_me_java;

import java.util.Calendar;
import java.util.LinkedList;
import java.util.List;

public class Event {
	
	private String name;
	private Calendar date = Calendar.getInstance();
	private List<Score> scores = new LinkedList<Score>();
	private int id;
	
	public Event(){
		
	}

	public int getId() {
		return id;
	}

	private void setId(int id) {
		this.id = id;
	}

	public Event(String eventName,Calendar date) {
		this.name = eventName;
		this.date = date;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Calendar getDate() {
		return date;
	}

	public void setDate(Calendar date) {
		this.date = date;
	}

	public void addRate(Score rate) {
		this.scores.add(rate);
		
	}

	public List<Score> getScores() {
		return scores;
	}

	public void setScores(List<Score> scores) {
		this.scores = scores;
	}

	public int Total(Score rate) {
		int total = 0;
		for (Score score : scores) {
			if(score.getOption() == rate.getOption()){
				total++;
			}
		}
		return total;
	}
	
    	

}
